package com.house.entity;
//账户状态枚举类
public enum AccountStatus {
    ACTIVE(0),     // 正常
    INACTIVE(1),   // 禁用
    FROZEN(2);     // 冻结

    private final int code;

    AccountStatus(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static AccountStatus fromCode(int code) {
        for (AccountStatus status : AccountStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid account status code: " + code);
    }
}
